<link href="../addons/jy_friends_shop/custom/templates/mobile/style.css?v=201705251730" rel="stylesheet">
<style>
	.fui-cell-label{
		align-self: flex-start;
		line-height: normal;
	}

</style>
<div ng-if="pagedata.op=='main'" class="fui-page fui-page page-commission-selectgoods">
    <div class="fui-content navbar">
	<div class="fui-fullHigh-group" >
        <div class="fui-fullHigh-item menu" id="tab">
            <nav class="on">代理的商品</nav>
        </div>
        <div class="fui-fullHigh-item container">
              <div class="searchbar" style='margin:0;padding:0'>
                    <div class="search-input">
                        <i class="icon icon-search" ng-click="tool.get_list('jy_friends_shop/agent.goods/getlist/keyword='+pagedata.params.keyword,true)"></i>
                        <input type="search" id='keywords' ng-model="pagedata.params.keyword" placeholder="输入关键字..." style="border: 1px solid #f7f7f7;">
                    </div>
              </div>
			   <div class="weui_btn_area c">
					 <a href="javascript:;" ng-click="access_json('jy_friends_shop/agent.cangoods/')" class='btn btn-sm btn-danger-o external' style="border-radius: 100px;width: 7rem;font-size: .75rem">添加代理商品</a>
				</div>
				<p ng-if="pagedata.list.length<1" class="text-center text-cancel empty" style="margin-top:2rem;color:#999">
				暂时没有任何商品
				</p>
				<div class="fui-list-group goods-list-group" style="margin-top:0;">
					<div ng-repeat="g in pagedata.list" class="fui-list goods-item">
							<div class="fui-list-media">
								<img ng-src="{{tomedia(g.image) || '../core/resource/images/nopic.jpg'}}" class='round'/>
							</div>
							<div class='fui-list-inner'>
								<div class='subtitle'>
									<span>{{g.title}}</span>
								</div>
								<div class='text'>
									<span class='text-danger'>￥{{g.price}}</span>
									<span class='delete'>原价：￥{{g.oldprice}}</span>
								</div>
								<div class='text'>
									<div class="btn btn-sm btn-red-o order-delete r-f" style="padding:0 0.2rem;margin-left:0.2rem;margin-top:0.3rem" href="javascript:;" ng-click="post({'id':g.id},'del','','','确定删除？')">删除</div>
									<div class="btn btn-sm btn-default-o order-delete r-f" style="padding:0 0.2rem;margin-top:0.3rem" href="javascript:;" ng-click="access_json('jy_friends_shop/agent.goods/detail/id='+g.goodsid)">编辑</div>
								</div>
							</div>						
					</div>
				</div>
				<div ng-if="pagedata.loading" class='infinite-loading'><span class='fui-preloader'></span><span class='text'> 正在加载...</span></div>
        </div> 
    </div>
</div>
</div>
<div ng-if="pagedata.op=='detail'" class="fui-page fui-page-current">
	<div class="fui-header">
        <div class="title">商品代理</div>
    </div>
	<div class='fui-content'>
		<div class='fui-cell-group'>
			<div class='fui-cell'>
				<div class='fui-cell-label'>商品名称</div>
				<div class='fui-cell-info'><input type="text" class='fui-input' id="shopname" ng-model="pagedata.goods.title"  placeholder=''/></div>
			</div>
			<div class='fui-cell'>
				<div class='fui-cell-label'>商品图片</div>
				<div class="fui-list jump">
					<a class="fui-list-media" >
						<img class="round" ng-src="{{tomedia(pagedata.goods.image) || '../core/resource/images/nopic.jpg'}}" />
					</a>
					
				</div>
			</div>
			<div class='fui-cell'>
				<div class='fui-cell-label'>代理加价</div>
				<div class='fui-cell-info'><input type="text" class='fui-input' ng-model="pagedata.item.addprice"  placeholder='商品成交后，加价的部分将成为您的代理佣金'/></div>
			</div>
		</div>
		 <div class="weui_btn_area">
		 <a class="weui_btn weui_btn_primary" href="javascript:" id="showTooltips" ng-click="post(pagedata.item,'detail')">提交</a>
		 </div>
	</div>
</div>
<div ng-include="sys_html('_footer')"></div>
<script>
if(scope.pagedata.op=='main'){
	scope.tool.get_list('jy_friends_shop/agent.goods/getlist/',true);
	scope.pagedata.scroll_bottom=function(){
		scope.tool.get_list('jy_friends_shop/agent.goods/getlist/');
	}
}

</script>